//
//  UIView+Extension.m
//  XiCheUserApp
//
//  Created by sanmi on 2017/8/24.
//  Copyright © 2017年 吴喜超. All rights reserved.
//

#import "UIView+Extension.h"

@implementation UIView (Extension)

- (XMBaseViewController *)viewController {
    UIResponder *responder = self;
    while ((responder = [responder nextResponder])) {
        if ([responder isKindOfClass:[UIViewController class]])
            return (XMBaseViewController *)responder;
    }
    
    // If the view controller isn't found, return nil.
    return nil;
}

@end
